package com.lxy.aimin.mcp.client.controller;


import org.springframework.ai.chat.client.ChatClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

@RestController
@RequestMapping("/weather")
public class WeatherController {

    @Autowired
    private ChatClient chatClient;


    @GetMapping
    public Flux<String> getWeather(String question) {
        return chatClient.prompt(question).stream().content();
    }
}
